import { kgjHttp as http } from '@/services/http';
import type { ListResult } from '@/types/api/common';
/**
 * 文章
 */

/** 列表 */
export const getList = (params: any, data: any) =>
  http<ListResult<any>, any, any>({ url: '/api/article/list', params, data, method: 'post' });
/** 详情 */
export const getDetail = (id: string | number) => http({ url: `/api/article/detail?id=${id}`, method: 'get' });
/** 创建 */
export const add = (data: any) => http({ url: '/api/article/add', method: 'post', data });
/** 更新 */
export const edit = (data: any) => http({ url: '/api/article/edit', method: 'post', data });
/** 删除 */
export const del = (id: any) => http({ url: `/api/article/delete?id=${id}`, method: 'get' });
/** 上下架: */
export const changeStatus = (data: any) => http({ url: '/api/article/shelf', method: 'post', data });
